import request from '@/utils/request'
export function gettime(query) {
    return request({
        url: 'user/userList/runOneWaringTimeline',
        method: 'get',
        params: query
    })
}

//警报等级列表
export function getWarnList(query) {
    return request({
        url: 'snap/warning/level/list',
        method: 'get',
        params: query
    })
}

//新建等级警报
export function addWarnLevel(data) {
    return request({
        url: 'snap/warning/level/add',
        method: 'post',
        data
    })
}

//更新等级警报
export function editWarnLevel(data) {
    return request({
        url: 'snap/warning/level/edit',
        method: 'post',
        data
    })
}

//删除等级警报
export function delWarnLevel(data) {
    return request({
        url: 'snap/warning/level/del',
        method: 'post',
        data
    })
}



//预警中心列表
export function getwarningListed(query) {
    return request({
        url: 'user/warning/listed',
        method: 'get',
        params: query
    })
}

//预警事件数量趋势图
export function getWarningLine(query) {
    return request({
        url: 'user/warning/line',
        method: 'get',
        params: query
    })
}

//预警事件类型占比图
export function getWarningPie(query) {
    return request({
        url: 'user/warning/pie',
        method: 'get',
        params: query
    })
}

//预警类型
export function typeOfAlert(query) {
    return request({
        url: 'user/warningType/list',
        method: 'get',
        params: query
    })
}

//新增
export function addWarning(data) {
    return request({
        url: 'user/warningType/add',
        method: "post",
        data
    })
}
//编辑
export function editWarning(data) {
    return request({
        url: 'user/warningType/update',
        method: "post",
        data
    })
}

//删除
export function delWarning(query) {
    return request({
        url: 'user/warningType/delete',
        method: "get",
        params: query
    })
}



export function addWarningType(data) {
    return request({
        url: 'snap/warning/type/add',
        method: "post",
        data
    })
} export function editWarningType(data) {
    return request({
        url: 'snap/warning/type/edit',
        method: "post",
        data
    })
}

export function getWarningTypeList(query) {
    return request({
        //  url: 'snap/warning/type/list',
        url: 'user/warningType/list',
        method: 'get',
        params: query
    })
}
export function delWarningType(data) {
    return request({
        url: 'snap/warning/type/del',
        method: 'post',
        data
    })
}

export function getWarningSearchType() {
    return request({
        url: 'user/warningType/list',
        method: 'get'
    })
}


// 一键处理
export function oneClickProcessing(data) {
    return request({
        url: 'user/warning/disposeList',
        method: 'post',
        data
    })
}

//预警处理
export function earlyWarningProcessing(query) {
    return request({
        url: 'user/warning/dispose',
        method: 'get',
        params: query
    })
}

//预警详情
export function alertDetails(query) {
    return request({
        url: 'user/warning/particulars',
        method: 'get',
        params: query
    })
}

//本月识别人数统计
export function handleWarningTime(query) {
    return request({
        url: 'SumUp/handleWarningTime',
        method: 'get',
        params: query
    })
}

//关怀预警名单
export function careAlertList(query) {
    return request({
        url: 'SumUp/careAlertList',
        method: 'get',
        params: query
    })
}
export function careAlertNum(query) {
    return request({
        url: 'SumUp/careAlertNum',
        method: 'get',
        params: query
    })
}


//本月最多一次跑问题名单
export function maxOneUserWarning(query) {
    return request({
        url: 'SumUp/maxOneUserWarning',
        method: 'get',
        params: query
    })
}

//本月平均业务办理时长
export function duration(query) {
    return request({
        url: 'SumUp/duration',
        method: 'get',
        params: query
    })
}

//最多跑一次名单（单个查询上月）
export function maxOneUserWarningById(query) {
    return request({
        url: 'SumUp/maxOneUserWarningById',
        method: 'get',
        params: query
    })
}